home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / CREATTEM.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  619 b   |  25 lines

  1. /* creattem.c --- p 491 */
  2. #include <stdio.h>
  3. #include <dos.h>
  4. #include <io.h>
  5. extern unsigned char _osmajor;
  6. main()
  7. {
  8.     int handle;
  9.     char dirname[60];
  10.     if(_osmajor <3)
  11.     {
  12.         printf("'creattemp' needs DOS version 3.0 or higher\n");
  13.         exit(0);
  14.     }
  15.     printf("Enter name of directory where the "
  16.           "temporary file will be created: ");
  17.     gets(dirname);
  18.             /* Call 'creattemp' to create the file. Mode 0 means
  19.              * a normal file. */
  20.     if((handle = creattemp(dirname, 0)) == -1)
  21.             perror("Error in creattemp")_;
  22.     else
  23.         printf("Temporary file %s created.\nRemember to delete.\n",
  24.                                 dirname);
  25. }